{
 "metadata": {
  "name": "",
  "signature": "sha256:9c1fd2f28cd03234bac27a7c8a5ebed12e28a7cc03c8306c2372e310377f0fe2"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The Rock Hyrax Problem\n",
      "----------------------\n",
      "\n",
      "Allen Downey\n",
      "\n",
      "This notebook contains a solution to a problem I posed in my Bayesian statistics class:\n",
      "\n",
      "> Suppose I capture and tag 10 rock hyraxes. \u00a0Some time later, I capture another 10 hyraxes and find that two of them are\n",
      "> already tagged. \u00a0How many hyraxes are there in this environment?\n",
      "\n",
      "This is an example of a mark and recapture experiment, which you can [read about on Wikipedia](http://en.wikipedia.org/wiki/Mark_and_recapture). \u00a0The Wikipedia page also includes the photo of a tagged hyrax shown above.\n",
      "\n",
      "As always with problems like this, we have to make some modeling assumptions.\n",
      "\n",
      "1) For simplicity, you can assume that the environment is reasonably isolated, so the number of hyraxes does not change between observations.\n",
      "\n",
      "2) And you can assume that each hyrax is equally likely to be captured during each phase of the experiment, regardless of whether it has been tagged. \u00a0In reality, it is possible that tagged animals would avoid traps in the future, or possible that the same behavior that got them caught the first time makes them more likely to be caught again. \u00a0But let's start simple.\n",
      "\n",
      "My solution uses the ThinkBayes2 framework, which is described in [Think Bayes](http://thinkbayes.com), and summarized in [this notebook](http://nbviewer.ipython.org/github/AllenDowney/ThinkBayes2/blob/master/code/framework.ipynb).\n",
      "\n",
      "I'll start by defining terms:\n",
      "\n",
      "$N$: total population of hyraxes\n",
      "$K$: number of hyraxes tagged in the first round\n",
      "$n$: number of hyraxes caught in the second round\n",
      "$k$: number of hyraxes in the second round that had been tagged\n",
      "\n",
      "So $N$ is the hypothesis and $(K, n, k)$ make up the data.  The probability of the data, given the hypothesis, is the probability of finding $k$ tagged hyraxes out of $n$ if (in the population) $K$ out of $N$ are tagged.  There are two ways we can compute this:\n",
      "\n",
      "1) If you are familiar with the [hypergeometric distribution](http://en.wikipedia.org/wiki/Hypergeometric_distribution), you might recognize this problem and use an implementation of the hypergeometric PMF, evaluated at $k$.\n",
      "\n",
      "2) Otherwise, you can figure it out using combinatorics.\n",
      "\n",
      "I'll do the second one first.  Out of a population of $N$ hyraxes, we captured $n$; the total number of combinations is $N \\choose n$.\n",
      "\n",
      "$k$ of the ones we caught are tagged, so $n-k$ are not.  The total number of combinations is ${K \\choose k}{N-K \\choose n-k}$.  So the probability of the data is\n",
      "\n",
      "${K \\choose k}{N-K \\choose n-k}/{N \\choose n}$\n",
      "\n",
      "`scipy.special` provides `binom(x, y)`, which computes the binomial coefficient, $x \\choose y$.\n",
      "\n",
      "So let's see how that looks in code:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# first a little house-keeping\n",
      "from __future__ import print_function, division\n",
      "% matplotlib inline"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import thinkbayes2\n",
      "from scipy.special import binom\n",
      "\n",
      "class Hyrax(thinkbayes2.Suite):\n",
      "    \"\"\"Represents hypotheses about how many hyraxes there are.\"\"\"\n",
      "\n",
      "    def Likelihood(self, data, hypo):\n",
      "        \"\"\"Computes the likelihood of the data under the hypothesis.\n",
      "\n",
      "        hypo: total population (N)\n",
      "        data: # tagged (K), # caught (n), # of caught who were tagged (k)\n",
      "        \"\"\"\n",
      "        N = hypo\n",
      "        K, n, k = data\n",
      "\n",
      "        if hypo < K + (n - k):\n",
      "            return 0\n",
      "\n",
      "        like = binom(N-K, n-k) / binom(N, n)\n",
      "        return like"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Again $N$ is the hypothesis and $(K, n, k)$ is the data.  If we've tagged $K$ hyraxes and then caught another $n-k$, the total number of unique hyraxes we're seen is $K + (n - k)$.  For any smaller value of N, the likelihood is 0.\n",
      "\n",
      "Notice that I didn't bother to compute $K \\choose k$; because it does not depend on $N$, it's the same for all hypotheses, so it gets cancelled out when we normalize the suite.\n",
      "\n",
      "Next I construct the prior and update it with the data.  I use a uniform prior from 0 to 999."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "hypos = range(1, 1000)\n",
      "suite = Hyrax(hypos)\n",
      "\n",
      "data = 10, 10, 2\n",
      "suite.Update(data)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 3,
       "text": [
        "0.0010248876709531896"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Here's what the posterior distribution looks like:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import thinkplot\n",
      "thinkplot.Pdf(suite)\n",
      "thinkplot.Config(xlabel='Number of hyraxes', ylabel='PMF', legend=False)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAEPCAYAAACOU4kjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8XHW9//HXZCYzWdok3Zc0bZou0NKFspRy2cKi1qpF\nfqLAxYsXvRdcql5X9HK9ptfrRb2iCChWWfUKeHHBohRkC+gtlgKlLXRN2nRJ6ULatGmWmSST3x/f\nMzNnpsnMJJnJzOS8n4/HPPI9Z77fM98c6HzyXQ+IiIiIiIiIiIiIiIiIiIiIiIiIiIiIZJ2lwDZg\nJ3BLH3nutN7fCCxKouxi4BVgA7AeODe1VRYRkWzmBuqASiAfeAOYE5NnGfCklT4P+FsSZWuB91jp\n9wIvpLriIiIyOHlpvPZiTIBoADqBR4ErY/IsBx6y0uuAMmBigrJvA6VWugxoTEflRURk4DxpvHY5\nsM92vB/TOkmUpxyYHKfs14C/At/HBMfzU1dlERFJh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N3Y8ZLREREUuI1oJb+\nd/WJiIiIiIiIiIiIiIiIiIiIiIiIiIiIiGSz/w8G8ibXdDINzAAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7fa7e16cfa50>"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "And here are some summaries of the posterior distribution:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print('Posterior mean', suite.Mean())\n",
      "print('Maximum a posteriori estimate', suite.MaximumLikelihood())\n",
      "print('90% credible interval', suite.CredibleInterval(90))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Posterior mean 185.570957948\n",
        "Maximum a posteriori estimate 50\n",
        "90% credible interval (36, 618)\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The combinatorial expression we computed is the PMF of the hypergeometric distribution, so we can also compute it using `thinkbayes2.EvalHypergeomPmf`, which uses `scipy.stats.hypergeom.pmf`."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import thinkbayes2\n",
      "\n",
      "class Hyrax2(thinkbayes2.Suite):\n",
      "    \"\"\"Represents hypotheses about how many hyraxes there are.\"\"\"\n",
      "\n",
      "    def Likelihood(self, data, hypo):\n",
      "        \"\"\"Computes the likelihood of the data under the hypothesis.\n",
      "\n",
      "        hypo: total population (N)\n",
      "        data: # tagged (K), # caught (n), # of caught who were tagged (k)\n",
      "        \"\"\"\n",
      "        N = hypo\n",
      "        K, n, k = data\n",
      "\n",
      "        if hypo < K + (n - k):\n",
      "            return 0\n",
      "\n",
      "        like = thinkbayes2.EvalHypergeomPmf(k, N, K, n)\n",
      "        return like\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 6
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "And the result is the same:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "hypos = range(1, 1000)\n",
      "suite = Hyrax2(hypos)\n",
      "\n",
      "data = 10, 10, 2\n",
      "suite.Update(data)\n",
      "\n",
      "thinkplot.Pdf(suite)\n",
      "thinkplot.Config(xlabel='Number of hyraxes', ylabel='PMF', legend=False)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAEPCAYAAACOU4kjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8XOV97/HPaEajxbIk77Is2bKxDcZsZjGGsIgljXFb\n09wshNtmoc2Fe1OXNM1CaJIip71JSZM0obTUNyGJk5StWQgpEEiIRUITDAZjG++bbEm25U2ydo1m\nuX88Z2bOjKSZkTSjmdH5vl+veeksz3P06IDPb571gIiIiIiIiIiIiIiIiIiIiIiIiIiIiEjOWQ3s\nAfYD942Q5iHr/DZgRQp5VwKvAVuB14Gr0ltkERHJZW7gAFAHFAJvAcvi0qwBnrO2rwZeTSFvI/Au\na/s2YFO6Cy4iIuNTkMFrr8QEiCZgEHgCuD0uzVpgo7W9GagEqpLkPQ5UWNuVQGsmCi8iImPnyeC1\n5wHNtv0WTO0kWZp5QHWCvJ8FXgG+igmO16SvyCIikg6ZrLmEUkznGuV1HwXuBeYDnwC+M8r8IiKS\nYZmsubQCtbb9WkwNJFGaGitNYYK8K4Fbre0fAd8e7pefd955oYMHD46p4CIiDnYQWJztQiTiwRSy\nDvCSvEN/FdEO/UR53wRutLZvwYwYG05IjAceeCDbRcgZuhdRuhdRuhdRpN7qlFAmay5+YB3wAmb0\n16PAbuAe6/wGTGBZg+m87wHuSpIX4G7gX4EioM/aFxGRHJLJ4ALwvPWx2xC3v24UeQG2MHRggIiI\n5JBMduhLjqivr892EXKG7kWU7kWU7kX6jXakVj6xmg9FRCRVLpcL0hAbV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37GXM2Ar23cxgaEfEwDDL0brt12rGFP7uAJTO3vAOhZ2MdEaXNhGzKKF8S7BLIb6v4H3\nY/qJRBJSzUUmg3bMQ/YviD5cmzAPVjDveCkc5TVdmJFcLszLphZhVol9AfgY0Qf9UqA0ybVex/Rx\nhJvFPoDp9xmr45gazeeJDah24UByBtN38z6i9+Z/YGo9NwL/gmnqegnTpDbLSjMdmG+V2YPp1/kC\nwzfhiQyhmovkM/s3/q9hahRh38J0rr+FeQ949wj54q8Xsm0fxTRNlQP3YJrRvo1pOnsTE3hOYkas\nJXqb33HMOzM2WXn+i+TDjIe7nn3/MWAmZrDBcOc7MPfgbcxLsTZbx2dgOvFvxtRoHga+CXwEE6xe\nxHzpHMQE0X5MAAt/EY1/m6WIiEwiD2P6S0RERNLiDaCR0Tf1iYiIiIiIiIiIiIiIiIiIiIiIiIiI\niIjksv8PtfEoZNyLxMwAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7fa7d51b61d0>"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print('Posterior mean', suite.Mean())\n",
      "print('Maximum a posteriori estimate', suite.MaximumLikelihood())\n",
      "print('90% credible interval', suite.CredibleInterval(90))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Posterior mean 185.570957948\n",
        "Maximum a posteriori estimate 50\n",
        "90% credible interval (36, 618)\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "If we run the analysis again with a different prior (running from 0 to 1999), the MAP is the same, but the posterior mean and credible interval are substantially different:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "hypos = range(1, 2000)\n",
      "suite = Hyrax2(hypos)\n",
      "data = 10, 10, 2\n",
      "suite.Update(data)\n",
      "\n",
      "print('Posterior mean', suite.Mean())\n",
      "print('Maximum a posteriori estimate', suite.MaximumLikelihood())\n",
      "print('90% credible interval', suite.CredibleInterval(90))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Posterior mean 233.983126212\n",
        "Maximum a posteriori estimate 50\n",
        "90% credible interval (36, 890)\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This difference indicates that we don't have enough data to swamp the priors, so a more definitive answer would require either more data or a prior based on more background information."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}